<Configure> (React InstantSearch v7)
A component for React InstantSearch. to provide search parameters to Algolia.
The <Configure>
component lets you provide raw search parameters to the Algolia API without rendering anything.
Any props you pass to this component are forwarded to Algolia.
Don’t make the widget itself conditional, for example, in a ternary statement. Doing so creates an infinite loop.
Props
A list of search parameters to enable.
Hook
To create your own UI for the <Configure> component, use the
useConfigure` Hook.
Hooks provide APIs to access the component state and interact with InstantSearch.
The useConfigure()
Hook accepts parameters and returns APIs.
Usage
Create your React component
Render the widget
Hook parameters
Hooks accept parameters. You can pass them manually, or forward the props from your custom component.
A list of search parameters to enable.
It returns an object with a refine
function that you can use to replace the provided search parameters with new ones.
When you provide a function to Hooks, make sure to pass a stable reference to avoid rendering endlessly
(for example, with useCallback()
).
Objects and arrays are memoized: you don’t need to stabilize them.
Hook APIs
Hooks return APIs, such as state and functions. You can use them to build your UI and interact with React InstantSearch.
Replaces the provided search parameters with new ones.